package dongshi.daddy.jh.changeGridName_kongjie;

import java.util.ArrayList;
import java.util.List;

public class Main {

    private static List<String> list17 = new ArrayList() {
        {
//            add("华苑社区");
//            add("华城社区");
//            add("华胜社区");
//            add("峨嵋社区");
//            add("新塘社区");
//            add("东方社区");
//            add("华兴社区");
//            add("电胜社区");
//            add("南苑社区");
//            add("汇贤社区");
//            add("金河社区");
//            add("新城社区");
            add("明星村");
            add("五联村");
            add("河头村");
            add("柘荡村");
            add("中塘村");
        }
    };
    public static void main(String[] args) {
        // 电胜社区01	1					1		2		电胜社区第1网格	r1	n个汉字+2个数字	n个汉字+第+数字取整+网格
//        case1Shanghu();
//        case1Zhuhu();
        // 电胜社区01_微网格02	655			824		1		1480		电胜社区第2网格-微网格2	r2	n个汉字+2个数字+下划线+微网格+2个数字	n个汉字+第+数字取整+网格+横线+微网格+数字取整	类别2
//        case2Shanghu();
//        case2Zhuhu();
//        case3Shanghu();
//        case3ShanghuCun();
//        case3Zhuhu();
//        case3ZhuhuCun();
//        case2Shanghu();
//        case4Shanghu();
//        case4ZhuhuCun();
        case4ShanghuCun();
    }
    private static void case4ZhuhuCun() {
        // update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='电胜社区第3网格-微网格1', business_data_json=replace(business_data_json, '电胜社区03_微网格01', '电胜社区第3网格-微网格1') where e8aaa52d635c42a9b2136a339097ecb9='电胜社区03_微网格01';
        String updateSql = "update tbl_jh_form_business_db22_DebLc5Wm set f436d8a558ec4b66bb5ff4d8db17a5bd='newName', business_data_json=replace(business_data_json, 'originName', 'newName') where f436d8a558ec4b66bb5ff4d8db17a5bd='originName'";
        for (int i = 0; i < list17.size(); i++) {
            String name = list17.get(i);
            System.out.println(name + ": ");
            for (int j = 0; j < 15; j++) {
                String gridNum = (j < 10 ? "0" + j : j + "");
                for (int k = 0; k < 15; k++) {
                    String mircoGridNum = (k < 10 ? "0" + k : k + "");
                    String originName = name.replace("村", "网格") + gridNum + "_微网格" + mircoGridNum;
                    String newName = name + "第" + j + "网格-微网格" + k;
                    String finalSql = updateSql.replaceAll("newName", newName);
                    finalSql = finalSql.replaceAll("originName", originName);
                    System.out.println(finalSql + ";");
                }
            }
            System.out.println("---------------------------------");
            System.out.println();
        }

    }

    private static void case4Zhuhu() {
        // update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='电胜社区第3网格-微网格1', business_data_json=replace(business_data_json, '电胜社区03_微网格01', '电胜社区第3网格-微网格1') where e8aaa52d635c42a9b2136a339097ecb9='电胜社区03_微网格01';
        String updateSql = "update tbl_jh_form_business_db22_DebLc5Wm set f436d8a558ec4b66bb5ff4d8db17a5bd='newName', business_data_json=replace(business_data_json, 'originName', 'newName') where f436d8a558ec4b66bb5ff4d8db17a5bd='originName'";
        for (int i = 0; i < list17.size(); i++) {
            String name = list17.get(i);
            System.out.println(name + ": ");
            for (int j = 0; j < 15; j++) {
                String gridNum = (j < 10 ? "0" + j : j + "");
                for (int k = 0; k < 15; k++) {
                    String mircoGridNum = (k < 10 ? "0" + k : k + "");
                    String originName = name.replace("社区", "网格")  + gridNum + "_微网格" + mircoGridNum;
                    String newName = name + "第" + j + "网格-微网格" + k;
                    String finalSql = updateSql.replaceAll("newName", newName);
                    finalSql = finalSql.replaceAll("originName", originName);
                    System.out.println(finalSql + ";");
                }
            }
            System.out.println("---------------------------------");
            System.out.println();
        }

    }
    private static void case2Zhuhu() {
        // update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='电胜社区第3网格-微网格1', business_data_json=replace(business_data_json, '电胜社区03_微网格01', '电胜社区第3网格-微网格1') where e8aaa52d635c42a9b2136a339097ecb9='电胜社区03_微网格01';
        String updateSql = "update tbl_jh_form_business_db22_DebLc5Wm set f436d8a558ec4b66bb5ff4d8db17a5bd='newName', business_data_json=replace(business_data_json, 'originName', 'newName') where f436d8a558ec4b66bb5ff4d8db17a5bd='originName'";
        for (int i = 0; i < list17.size(); i++) {
            String name = list17.get(i);
            System.out.println(name + ": ");
            for (int j = 0; j < 15; j++) {
                String gridNum = (j < 10 ? "0" + j : j + "");
                for (int k = 0; k < 15; k++) {
                    String mircoGridNum = (k < 10 ? "0" + k : k + "");
                    String originName = name + gridNum + "_微网格" + mircoGridNum;
                    String newName = name + "第" + j + "网格-微网格" + k;
                    String finalSql = updateSql.replaceAll("newName", newName);
                    finalSql = finalSql.replaceAll("originName", originName);
                    System.out.println(finalSql + ";");
                }
            }
            System.out.println("---------------------------------");
            System.out.println();
        }

    }
    private static void case4ShanghuCun() {
        // update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='电胜社区第3网格-微网格1', business_data_json=replace(business_data_json, '电胜社区03_微网格01', '电胜社区第3网格-微网格1') where e8aaa52d635c42a9b2136a339097ecb9='电胜社区03_微网格01';
        String updateSql = "update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='newName', business_data_json=replace(business_data_json, 'originName', 'newName') where e8aaa52d635c42a9b2136a339097ecb9='originName'";
        for (int i = 0; i < list17.size(); i++) {
            String name = list17.get(i);
            System.out.println(name + ": ");
            for (int j = 0; j < 15; j++) {
                String gridNum = (j < 10 ? "0" + j : j + "");
                for (int k = 0; k < 15; k++) {
                    String mircoGridNum = (k < 10 ? "0" + k : k + "");
                    String originName = name.replace("村", "网格") + gridNum + "_微网格" + mircoGridNum;
                    String newName = name + "第" + j + "网格-微网格" + k;
                    String finalSql = updateSql.replaceAll("newName", newName);
                    finalSql = finalSql.replaceAll("originName", originName);
                    System.out.println(finalSql + ";");
                }
            }
            System.out.println("---------------------------------");
            System.out.println();
        }

    }

    private static void case4Shanghu() {
        // update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='电胜社区第3网格-微网格1', business_data_json=replace(business_data_json, '电胜社区03_微网格01', '电胜社区第3网格-微网格1') where e8aaa52d635c42a9b2136a339097ecb9='电胜社区03_微网格01';
        String updateSql = "update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='newName', business_data_json=replace(business_data_json, 'originName', 'newName') where e8aaa52d635c42a9b2136a339097ecb9='originName'";
        for (int i = 0; i < list17.size(); i++) {
            String name = list17.get(i);
            System.out.println(name + ": ");
            for (int j = 0; j < 15; j++) {
                String gridNum = (j < 10 ? "0" + j : j + "");
                for (int k = 0; k < 15; k++) {
                    String mircoGridNum = (k < 10 ? "0" + k : k + "");
                    String originName = name.replace("社区", "网格") + gridNum + "_微网格" + mircoGridNum;
                    String newName = name + "第" + j + "网格-微网格" + k;
                    String finalSql = updateSql.replaceAll("newName", newName);
                    finalSql = finalSql.replaceAll("originName", originName);
                    System.out.println(finalSql + ";");
                }
            }
            System.out.println("---------------------------------");
            System.out.println();
        }

    }

    private static void case2Shanghu() {
        // update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='电胜社区第3网格-微网格1', business_data_json=replace(business_data_json, '电胜社区03_微网格01', '电胜社区第3网格-微网格1') where e8aaa52d635c42a9b2136a339097ecb9='电胜社区03_微网格01';
        String updateSql = "update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='newName', business_data_json=replace(business_data_json, 'originName', 'newName') where e8aaa52d635c42a9b2136a339097ecb9='originName'";
        for (int i = 0; i < list17.size(); i++) {
            String name = list17.get(i);
            System.out.println(name + ": ");
            for (int j = 0; j < 15; j++) {
                String gridNum = (j < 10 ? "0" + j : j + "");
                for (int k = 0; k < 15; k++) {
                    String mircoGridNum = (k < 10 ? "0" + k : k + "");
                    String originName = name + gridNum + "_微网格" + mircoGridNum;
                    String newName = name + "第" + j + "网格-微网格" + k;
                    String finalSql = updateSql.replaceAll("newName", newName);
                    finalSql = finalSql.replaceAll("originName", originName);
                    System.out.println(finalSql + ";");
                }
            }
            System.out.println("---------------------------------");
            System.out.println();
        }

    }

    private static void case1Zhuhu() {
        // update tbl_jh_form_business_db22_DebLc5Wm set e8aaa52d635c42a9b2136a339097ecb9='华兴社区第3网格', business_data_json=replace(business_data_json, '华兴社区03', '华兴社区第3网格') where e8aaa52d635c42a9b2136a339097ecb9='华兴社区03'
        String updateSql = "update tbl_jh_form_business_db22_DebLc5Wm set f436d8a558ec4b66bb5ff4d8db17a5bd='%s第%s网格', business_data_json=replace(business_data_json, '%s', '%s') where f436d8a558ec4b66bb5ff4d8db17a5bd='%s'";
        for (int i = 0; i < list17.size(); i++) {
            String name = list17.get(i);
            System.out.println(name + ": ");
            for (int j = 0; j < 15; j++) {
                String originName = name + (j < 10 ? "0" + j : j);
                String finalSql = String.format(updateSql, name, j, originName, name + "第" + j + "网格", originName);
                System.out.println(finalSql + ";");
            }
            System.out.println("---------------------------------");
            System.out.println();
        }
    }


    private static void case3ShanghuCun() {
        // update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='华兴社区第3网格', business_data_json=replace(business_data_json, '华兴社区03', '华兴社区第3网格') where e8aaa52d635c42a9b2136a339097ecb9='华兴社区03'
        String updateSql = "update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='%s第%s网格', business_data_json=replace(business_data_json, '%s', '%s') where e8aaa52d635c42a9b2136a339097ecb9='%s'";
        for (int i = 0; i < list17.size(); i++) {
            String name = list17.get(i);
            System.out.println(name + ": ");
            for (int j = 0; j < 15; j++) {
                String originName = name + (j < 10 ? "0" + j : j);
                String finalSql = String.format(updateSql, name, j, originName.replace("村", "网格"), name + "第" + j + "网格", originName.replace("村", "网格"));
                System.out.println(finalSql + ";");
            }
            System.out.println("---------------------------------");
            System.out.println();
        }
    }

    private static void case3ZhuhuCun() {
        // update tbl_jh_form_business_db22_DebLc5Wm set e8aaa52d635c42a9b2136a339097ecb9='华兴社区第3网格', business_data_json=replace(business_data_json, '华兴社区03', '华兴社区第3网格') where e8aaa52d635c42a9b2136a339097ecb9='华兴社区03'
        String updateSql = "update tbl_jh_form_business_db22_DebLc5Wm set f436d8a558ec4b66bb5ff4d8db17a5bd='%s第%s网格', business_data_json=replace(business_data_json, '%s', '%s') where f436d8a558ec4b66bb5ff4d8db17a5bd='%s'";
        for (int i = 0; i < list17.size(); i++) {
            String name = list17.get(i);
            System.out.println(name + ": ");
            for (int j = 0; j < 15; j++) {
                String originName = name + (j < 10 ? "0" + j : j);
                String finalSql = String.format(updateSql, name, j, originName.replace("村", "网格"), name + "第" + j + "网格", originName.replace("村", "网格"));
                System.out.println(finalSql + ";");
            }
            System.out.println("---------------------------------");
            System.out.println();
        }
    }

    private static void case3Zhuhu() {
        // update tbl_jh_form_business_db22_DebLc5Wm set e8aaa52d635c42a9b2136a339097ecb9='华兴社区第3网格', business_data_json=replace(business_data_json, '华兴社区03', '华兴社区第3网格') where e8aaa52d635c42a9b2136a339097ecb9='华兴社区03'
        String updateSql = "update tbl_jh_form_business_db22_DebLc5Wm set f436d8a558ec4b66bb5ff4d8db17a5bd='%s第%s网格', business_data_json=replace(business_data_json, '%s', '%s') where f436d8a558ec4b66bb5ff4d8db17a5bd='%s'";
        for (int i = 0; i < list17.size(); i++) {
            String name = list17.get(i);
            System.out.println(name + ": ");
            for (int j = 0; j < 15; j++) {
                String originName = name + (j < 10 ? "0" + j : j);
                String finalSql = String.format(updateSql, name, j, originName, name + "第" + j + "网格", originName.replace("社区", "网格"));
                System.out.println(finalSql + ";");
            }
            System.out.println("---------------------------------");
            System.out.println();
        }
    }

    private static void case1Shanghu() {
        // update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='华兴社区第3网格', business_data_json=replace(business_data_json, '华兴社区03', '华兴社区第3网格') where e8aaa52d635c42a9b2136a339097ecb9='华兴社区03'
        String updateSql = "update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='%s第%s网格', business_data_json=replace(business_data_json, '%s', '%s') where e8aaa52d635c42a9b2136a339097ecb9='%s'";
        for (int i = 0; i < list17.size(); i++) {
            String name = list17.get(i);
            System.out.println(name + ": ");
            for (int j = 0; j < 15; j++) {
                String originName = name + (j < 10 ? "0" + j : j);
                String finalSql = String.format(updateSql, name, j, originName, name + "第" + j + "网格", originName);
                System.out.println(finalSql + ";");
            }
            System.out.println("---------------------------------");
            System.out.println();
        }
    }


    private static void case3Shanghu() {
        // update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='华兴社区第3网格', business_data_json=replace(business_data_json, '华兴社区03', '华兴社区第3网格') where e8aaa52d635c42a9b2136a339097ecb9='华兴社区03'
        String updateSql = "update tbl_jh_form_business_db22_v6BBCHvv set e8aaa52d635c42a9b2136a339097ecb9='%s第%s网格', business_data_json=replace(business_data_json, '%s', '%s') where e8aaa52d635c42a9b2136a339097ecb9='%s'";
        for (int i = 0; i < list17.size(); i++) {
            String name = list17.get(i);
            System.out.println(name + ": ");
            for (int j = 0; j < 15; j++) {
                String originName = name + (j < 10 ? "0" + j : j);
                String finalSql = String.format(updateSql, name, j, originName, name + "第" + j + "网格", originName.replace("社区", "网格"));
                System.out.println(finalSql + ";");
            }
            System.out.println("---------------------------------");
            System.out.println();
        }
    }

}
